<template>
  <div class="item">
    <input type="checkbox" v-model="item.isCheck" />
    <span>{{item.todo}}</span>
    <button v-if="item.isCheck" @click="deleteOne(item.id)">清除任务</button>
  </div>
</template>

<script>
export default {
    name:'MyItem',
    props:{
        item:{}
    },
    data(){
        return {
            items:this.item
        }
    },
    updated(){
      this.changeOne()
    },
    methods:{
      deleteOne(id){
        this.$emit('deleteOne',id);
      },
      changeOne(){
        this.$emit('changeOne');
      }
    }
}
</script>

<style lang="css" scoped>

</style>